home *** CD-ROM | disk | FTP | other *** search
- /** $VER: CmdShell.acrx 1.0 (08 Jun 1994)
- ** ArCo's
- ** Original by David N. Junod
- ** Modified by Bill Hawes
- ** Modified by Michael Sewell
- **/
-
-
- OPTIONS RESULTS
- OPTIONS FAILAT 100
- OPTIONS PROMPT "Cmd> "
-
- ADDRESS ARCO
- /* Display instructions */
- /* SAY 'Enter commands, or press CTRL-\ to exit.' */
-
- /* Get input until the user closes the Command Shell */
- DO FOREVER
-
- /* Wait until the user types a command followed by RETURN */
- PARSE PULL cmdString
-
- SELECT
- WHEN (cmdString = "") | (UPPER(cmdString) = "Q") | (UPPER(cmdString) = "ENDCLI") THEN do
- LEAVE
- END
-
- WHEN (cmdString = "?") | (UPPER(cmdString) = "HELP") THEN DO
- SAY 'Enter "HELP <command>" to obtain a command''s template.'
- END;
-
- WHEN (WORDS(cmdString) = "2") & (UPPER(WORD(cmdString,1)) = "HELP") THEN do
- CALL help(cmdString)
- END;
-
- OTHERWISE DO
- CALL HandleCmd(cmdString)
- END;
-
- END
- END
-
- RETURN
-
-
- HandleCmd: PROCEDURE
- PARSE ARG cmdString
-
- /* Execute the command */
- cmdString
-
- /* See if the command succeeded */
- IF RC = 0 THEN do
- IF symbol('RESULT') == "VAR" THEN DO
- SAY RESULT
- END
- RETURN
- END
-
- /* Wasn't an editor command, try running it as an ARexx script */
- if RC > 0 THEN DO
- ADDRESS REXX cmdString
-
- /* Wasn't an ARexx script, try running it as a CLI command */
- IF RC > 0 THEN DO
- ADDRESS COMMAND cmdString
- END
-
- END;
-
- RETURN
- /* end of HandleCmd() */
-
- help: PRODEDURE
- ARG one item
-
- SELECT
- WHEN (item = "LOCK") THEN do
- SAY item' grants you exclusive access to ArCos Arexx commands'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "UNLOCK") THEN do
- SAY item' releases exclusive access to ArCos Arexx commands'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "QUIT") THEN do
- SAY item' shuts down ArCo, if QUIT_REQUEST is FALSE, you will not be'
- SAY 'prompted as to whether you wish to quit or not'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "LAUNCHMACRO") THEN do
- SAY item' will launch another Arexx macro'
- SAY 'TEMPLATE : 'item' <macro>'
- END;
-
- WHEN (item = "SETSRCFILE") THEN do
- SAY item' sets the ArCo source file to the argument supplied, if no'
- SAY 'argument is supplied, A filerequestor will prompt the user'
- SAY 'TEMPLATE : 'item' [file name]'
- END;
-
- WHEN (item = "SETOBJFILE") THEN do
- SAY item' sets the ArCo object file to the argument supplied, if no'
- SAY 'argument is supplied, A filerequestor will prompt the user'
- SAY 'TEMPLATE : 'item' [file name]'
- END;
-
- WHEN (item = "SETEXECFILE") THEN do
- SAY item' sets the ArCo executable file to the argument supplied, if no'
- SAY 'argument is supplied, A filerequestor will prompt the user'
- SAY 'TEMPLATE : 'item' [file name]'
- END;
-
- WHEN (item = "SETSRCDIR") THEN do
- SAY item' sets the ArCo source directory to the argument supplied.'
- SAY 'TEMPLATE : 'item' <directory>'
- END;
-
- WHEN (item = "SETOBJDIR") THEN do
- SAY item' sets the ArCo object directory to the argument supplied.'
- SAY 'TEMPLATE : 'item' <directory>'
- END;
-
- WHEN (item = "SETEXECDIR") THEN do
- SAY item' sets the ArCo executable directory to the argument supplied.'
- SAY 'TEMPLATE : 'item' <directory>'
- END;
-
- WHEN (item = "SETLIBDIR") THEN do
- SAY item' sets the ArCo link library directory to the argument supplied.'
- SAY 'TEMPLATE : 'item' <directory>'
- END;
-
- WHEN (item = "SETREADER") THEN do
- SAY item' determines the default tool to Read the src file or script output'
- SAY 'TEMPLATE : 'item' <tool>'
- END;
-
- WHEN (item = "SETEDITOR") THEN do
- SAY item' determines the default tool to Edit the src file or script output'
- SAY 'TEMPLATE : 'item' <tool>'
- END;
-
- WHEN (item = "ICONIFY") THEN do
- SAY item' switches ArCo to an Iconified state.'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "OPENGUI") THEN do
- SAY item' switches ArCo to the main interface panel.'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "REXXONLY") THEN do
- SAY item' closes all visible signs of ArCo, acces can only be through'
- SAY 'the Arexx port, which is names ARCO.'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "TELL") THEN do
- SAY item' will pass on information to the user, but ONLY if the verbose'
- SAY 'variable has been set to TRUE. '
- SAY 'TEMPLATE : 'item' <string>'
- END;
-
- WHEN (item = "SHOUT") THEN do
- SAY item' will inform the user and does not use the verbose variable'
- SAY 'Used for error reporting etc.'
- SAY 'TEMPLATE : 'item' <string>'
- END;
-
- WHEN (item = "REQUEST") THEN do
- SAY item' will pass on information to the uservia a system requestor'
- SAY 'Used for urgent error messages that may be overlooked if put through'
- SAY 'the ArCo stasis window'
- SAY 'TEMPLATE : 'item' <string>'
- END;
-
- WHEN (item = "VERSION") THEN do
- SAY item' sets the ArCo variable 'item', Causing the insertion of a version'
- SAY 'string in to the compiled file,'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "VERBOSE") THEN do
- SAY item' sets the ArCo variable 'item', allowing the reporting of all'
- SAY 'actions in the ArCo stasis window'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "RUN") THEN do
- SAY 'When set, ArCo will run the executable after compilation'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "WRITEICON") THEN do
- SAY 'When set, ArCo will Write out icons for ALL file output.'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "ADDLINKLIB") THEN do
- SAY item' will add the given link libraries to the list of libraries'
- SAY 'to be searched during compilation.'
- SAY 'TEMPLATE : 'item' <linklib1> [linklib2] [linklib3]...[linklib15]'
- END;
-
- WHEN (item = "GETLINKLIB") THEN do
- SAY item' will allow the user to choose a link library via an ASL file'
- SAY 'requestor'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "REMLINKLIB") THEN do
- SAY item' will remove the given link libraries from the list of libraries'
- SAY 'to be searched during compilation.'
- SAY 'TEMPLATE : 'item' <linklib1> [linklib2] [linklib3]...[linklib15]'
- END;
-
- WHEN (item = "RESETLIBLIST") THEN do
- SAY item' will remove all link libraries from the list, freeing memory'
- SAY 'and re-initialising the list.'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "SETAUTHOR") THEN do
- SAY item' determines the author string that is inserted in compiled'
- SAY 'scripts and also forms part of the version string'
- SAY 'do NOT use any puntuation marks,'
- SAY 'TEMPLATE : 'item' <name string>'
- END;
-
- WHEN (item = "LOADPREFS") THEN do
- SAY item' will cause ArCo to load the prefs file supplied as an argument,'
- SAY 'if no argument is supplied, A filerequestor will prompt the user'
- SAY 'TEMPLATE : 'item' [prefsfile]'
- END;
-
- WHEN (item = "SAVEPREFS") THEN do
- SAY item' will cause ArCo to save the preferences to the default prefs'
- SAY 'file which is set in ArCo''s tool types.'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "SAVEPREFSAS") THEN do
- SAY item' will cause ArCo to save the preferences to a file supplied as'
- SAY 'an argument,A filerequestor is supplied if there is no argument.'
- SAY 'TEMPLATE : 'item' [prefsfile]'
- END;
-
- WHEN (item = "SETOUTPUT") THEN do
- SAY item' denotes the filetype that is produced by ArCo, Choice of 4'
- SAY 'EXECUTABLE, LIBRARYOBJECT, LINKOBJECT & SCRIPT, if no argument is'
- SAY 'supplied, defaults to EXECUTABLE.'
- SAY 'TEMPLATE : 'item' [filetype]'
- END;
-
- WHEN (item = "SETDESTLIB") THEN do
- SAY item' will set the destination link library that the compiled'
- SAY 'object file will be added to, ONLY OF USE IF OUTPUT TYPE IS'
- SAY 'SET TO LIBRARY OBJECT'
- SAY 'TEMPLATE : 'item' <linklibrary>'
- END;
-
- WHEN (item = "COMPILE") THEN do
- SAY item' sets the compilation process in motion, if an argument is'
- SAY 'supplied, Then this is compiled instead of anything that may'
- SAY 'already be set as the source file.'
- SAY 'TEMPLATE : 'item' [source file]'
- END;
-
- WHEN (item = "GETINTERRUPTS") THEN do
- SAY item' opens the interrupt requestor for the user to choose which'
- SAY 'interrupts they wish to use.'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "GETTRACE") THEN do
- SAY item' opens the trace requestor for the user to choose which'
- SAY 'trace options they wish to use.'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "GETARGS") THEN do
- SAY item' opens the arguments requestor for the user to choose which'
- SAY 'arguments are to be passed to their compiled program when run'
- SAY 'This will only open the requestor if RUN has already been set'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "SETENVIRONMENT") THEN do
- SAY item' denotes which environment you wish to run your compiled'
- SAY 'program in, Either Cli or WB, If no argument is passed, It'
- SAY 'assumes WB.'
- SAY 'TEMPLATE : 'item' [type]'
- END;
-
- WHEN (item = "SETCLIARGS") THEN do
- SAY item' denotes the arguments that are to be passed to the compiled'
- SAY 'program when run in a CLI environment'
- SAY 'TEMPLATE : 'item' <argument string>'
- END;
-
- WHEN (item = "SETWBARGS") THEN do
- SAY item' denotes the arguments that are to be passed to the compiled'
- SAY 'program when run in a WB environment'
- SAY 'TEMPLATE : 'item' <argument 1> [argument 2].......[argument 15]'
- END;
-
- WHEN (item = "CLOSEARGSWINDOW") THEN do
- SAY item' will close the argument requestor, but is only of use OUTSIDE'
- SAY 'the script that called GETARGS as the script then waits for the'
- SAY 'argument requestor to close before continuing.'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "RESETARGS") THEN do
- SAY item' will clear the arguments back to thedefault values'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "CANCELARGS") THEN do
- SAY item' will return the argument values to those that were SNAPPED'
- SAY 'using the command SNAPARGS, If the requestor was opened by another'
- SAY 'script, The values in use prior to the requestor will be used'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "SETTRACE") THEN do
- SAY 'When set, will add the trace option in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETTR_ALL") THEN do
- SAY 'When set, will add the trace all option in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETTR_COMMANDS") THEN do
- SAY 'When set, will add the trace commands option in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETTR_ERRORS") THEN do
- SAY 'When set, will add the trace errors option in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETTR_INTERM") THEN do
- SAY 'When set, will add the trace intermediates option in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETTR_LABELS") THEN do
- SAY 'When set, will add the trace labels option in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETTR_NORMAL") THEN do
- SAY 'When set, will add the trace normal option in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETTR_RESULTS") THEN do
- SAY 'When set, will add the trace results option in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETTR_SCAN") THEN do
- SAY 'When set, will add the trace scan option in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETTR_INTERACTIVE") THEN do
- SAY 'When set, will add the trace interactive option in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETINTERRUPT") THEN do
- SAY 'When set, will add the interrupt option in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETSIG_BRKC") THEN do
- SAY 'When set, will add the interrupt option break_C in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETSIG_BRKD") THEN do
- SAY 'When set, will add the interrupt option break_D in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETSIG_BRKE") THEN do
- SAY 'When set, will add the interrupt option break_E in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETSIG_BRKF") THEN do
- SAY 'When set, will add the interrupt option break_F in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETSIG_ERROR") THEN do
- SAY 'When set, will add the interrupt option erorr in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETSIG_HALT") THEN do
- SAY 'When set, will add the interrupt option halt in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETSIG_IOERR") THEN do
- SAY 'When set, will add the interrupt option ioerr in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "SETSIG_SYNTAX") THEN do
- SAY 'When set, will add the interrupt option syntax in the compiled file'
- SAY 'If there is NO argument, it is assumed to be TRUE.'
- SAY 'TEMPLATE : 'item' [BOOL]'
- END;
-
- WHEN (item = "CLOSETRACEWINDOW") THEN do
- SAY item' will close the trace requestor, but is only of use OUTSIDE'
- SAY 'the script that called GETTRACE as the script then waits for the'
- SAY 'trace requestor to close before continuing.'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "RESETTRACE") THEN do
- SAY item' will clear the trace options, i.e. ALL REMOVED'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "CANCELTRACE") THEN do
- SAY item' will return the argument values to those that were SNAPPED'
- SAY 'using the command SNAPTRACE, If the requestor was opened by another'
- SAY 'script, The values in use prior to the requestor will be used'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "CLOSEINTERRUPTSWINDOW") THEN do
- SAY 'This will close the interrupts requestor, but is only of use OUTSIDE'
- SAY 'the script that called GETINTERRUPTS as the script then waits for the'
- SAY 'trace requestor to close before continuing.'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "RESETINTERRUPTS") THEN do
- SAY item' will clear the interrupt options, i.e. ALL REMOVED'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "CANCELINTERRUPT") THEN do
- SAY item' will return the argument values to those that were SNAPPED'
- SAY 'using the command SNAPINTERRUPT, If the requestor was opened by another'
- SAY 'script, The values in use prior to the requestor will be used'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "SNAPARGS") THEN do
- SAY item' will snapshot the current state of argument options for use'
- SAY 'as a backup.( restored with CANCELARGS )'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "SNAPTRACE") THEN do
- SAY item' will snapshot the current state of trace options for use'
- SAY 'as a backup.( restored with CANCELTRACE )'
- SAY 'TEMPLATE : 'item' '
- END;
-
- WHEN (item = "SNAPINTERRUPTS") THEN do
- SAY item' will snapshot the current state of interrupt options for'
- SAY 'use as a backup.( restored with CANCELINTERRUPTS )'
- SAY 'TEMPLATE : 'item' '
- END;
-
- OTHERWISE do
- SAY item' NOT RECOGNISED AS AN ARCO COMMAND!'
- END;
-
- END
- RETURN
-